
def count(n):
    count = 0
    while n > 0:
        digitsum = sum(int(digit) for digit in str(n))
        n-=digitsum
        count+=1

    return count

if __name__ == '__main__':
    n = int(input())
    print(count(n))